package https.itmanager.com.springboot.controller;

import https.itmanager.com.springboot.dao.domain.Authors;
import https.itmanager.com.springboot.service.AuthorsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/demo")
public class AuthorsController {

    @Resource
    private AuthorsService authorsService;

    @RequestMapping(value = "/authors.do", method = RequestMethod.GET)
    @ResponseBody
    public List<Authors> findAuthors(){
        return authorsService.findAuthors();
    }
}
